package mest.dao.LGF.WarehouseWorkFinish;

import mest.VO.LGF.WarehousePurchase.warehousesave_manytomanyVO;  //此处可以直接用采购的VO，不用怀疑
import mest.VO.LGF.WarehousePurchase.warehousesave_manytomany_recordVO;
import mest.VO.LGF.WarehouseWorkFinish.warehouse_productjob_workfinishVO;
import mest.VO.LGF.WarehouseWorkFinish.warehouse_productjob_workfinish_recordVO;
import mest.VO.LGF.WarehouseWorkFinish.warehouse_workfinishVO;
import mest.entity.warehouse_productjob_workfinish_record;
import mest.entity.warehousesave_manytomany;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description
 * @auther Machenike
 * @create 2019-12-20 21:52
 */
public interface IWarehouseWorkFinishDao {
    //1.未完成基本查询-数量
    int countNOFinish(@Param("theirDb") String theirDb);

    //2.未完成基本查询-分页
    List<warehouse_workfinishVO> selectAllNOFinish(@Param("theirDb") String theirDb,@Param("index") int index, @Param("pageSize") int pageSize);

    //3.已完成基本查询-数量
    int countFinish(@Param("theirDb") String theirDb);

    //4.已完成基本查询-分页
    List<warehouse_workfinishVO> selectAllFinish(@Param("theirDb") String theirDb,@Param("index") int index, @Param("pageSize") int pageSize);

    //1级弹出层查看完工情况--分页
    List<warehouse_productjob_workfinishVO> selectWorkFinishDetail(@Param("theirDb") String theirDb,@Param("wwId") int wwId ,@Param("index") int index, @Param("pageSize") int pageSize);
    //1级弹出层查看完工情况--数量
    int selectWorkFinishDetailCount(@Param("theirDb") String theirDb,@Param("wwId") int wwId);

    //2级弹出层查看入库往期记录--分页
    List<warehouse_productjob_workfinish_recordVO> selectWorkFinishPastRecord(@Param("theirDb") String theirDb,@Param("wpwId") int wpwId,@Param("index") int index, @Param("pageSize") int pageSize);
    //2级弹出层查看入库往期记录--数量
    int selectWorkFinishPastRecordCount(@Param("theirDb") String theirDb,@Param("wpwId") int wpwId);

    //2级弹出层提交完工入库增加入库记录
    int addRecord(warehouse_productjob_workfinish_record wpwr)  throws Exception;
    //2级弹出层提交添加记录后更新hasbeenNumber
    int updatehasBeenNumber(warehouse_productjob_workfinish_record wpwr)  throws Exception;
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象
    warehousesave_manytomany findWSMTMbysfIdAndWfId(@Param("theirDb")String theirDb, @Param("wfId")int wfId, @Param("sfId")int sfId);
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象，无中生有
    int addWSMTM( warehousesave_manytomanyVO wsmtmVO);
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象，插入记录
    int addWSMTMRecord( warehousesave_manytomany_recordVO wsmtmVO);
    //修改warehousesave_manytomany种的number数量
    int updateWSMTMNumber(warehousesave_manytomany_recordVO wsmtmVO);
    //修改生产单的完工入库数量
    int updateProductOrderTotalProductNumber(warehouse_productjob_workfinish_recordVO wpwrVO);


    //完单操作
    int updateByWWId(@Param("theirDb") String theirDb,@Param("wwId") int ppmId,@Param("finishStatus")int status) throws Exception;
}
